import jsonpath
import requests

data = {
    "accounts": "hu2374145",
    "pwd": "hu2374145",
    "type": "username"
}
headers = {
    "content-type": "application/json"
}
params = {
    "application": "app",
    "application_client_type": "weixin"
}

# 01.登录
url = "http://shop-xo.hctestedu.com/index.php?s=api/user/login"
res = requests.post(url=url, headers=headers, json=data, params=params)
res_json=jsonpath.jsonpath(res.json(),"$..data")
print(res_json[0])
print(res.text)